import React from 'react';
import PropTypes from 'prop-types';
import DefaultFormItem from '@welab/fx-ui/components/FormItem';
// import fn from '@welab/fx-ui/components/PlateformHalf';
import { formItem } from '../theme';
import SystemIcon from './SystemIcon';

const FormItem = props => (<DefaultFormItem {...props} iconComponent={SystemIcon} />);
FormItem.defaultProps = {
  label: null,
  status: 'normal',
  icoArrow: false,
  icoClear: false,
  noBottomBorder: false,
  children: null,
  onClear: null,
  theme: formItem,
  frontIcon: null,
};
FormItem.propTypes = {
  /**
   * ### FormItem 属性说明
   *
   * 输入框
   *
   * | Name | Type | Default | Details | isRequired |
   * | ------:| -----------:| -----------: | -----------: | ------:|
   * | theme | string | | 输入框主题 | no |
   * | label | object | | 左边文字 | no |
   * | icoArrow | bool | | 是否有向右箭头 | no |
   * | icoClear | bool | | 是否有关闭按钮 | no |
   * | noBottomBorder | bool | | 去掉底部线条 | no |
   * | children | object | | 建议写输入框 | no |
   * | status | string | normal | normal或者disabled或者warn | no |
   * | onClear | function | | 关闭事件 | no |
   *
   * ### FormItem 代码示例(详见示例项目)
   *
   * ```html
   * <FormItem theme={theme}/>
   * ```
   */
  label: PropTypes.string,
  theme: PropTypes.instanceOf(Object),
  icoArrow: PropTypes.bool,
  icoClear: PropTypes.bool,
  noBottomBorder: PropTypes.bool,
  children: PropTypes.instanceOf(Object),
  frontIcon: PropTypes.instanceOf(Object),
  status: PropTypes.string,
  onClear: PropTypes.func,
};


export default FormItem;
